Open In Colab

=============================================================================¶

PROJETO FASE 6 - ENTREGA 1: VISÃO COMPUTACIONAL COM YOLO CUSTOMIZADO¶

Detecção de Bicicletas vs Carros usando YOLOv5¶

======================================================¶

🚀 Projeto Fase 6 - Entrega 1: Sistema de Visão Computacional¶

📋 Objetivo¶

Desenvolver um sistema de visão computacional usando YOLOv5 customizado para detectar e classificar bicicletas e carros em imagens.

🎯 Metas da Entrega¶

  1. Dataset organizado: 80 imagens (40 bicicletas + 40 carros)
  2. Divisão: 32 treino, 4 validação, 4 teste (por classe)
  3. Rotulação feita no Make Sense IA
  4. Treinamento com 15 e 40 épocas
  5. Análise comparativa dos resultados
  6. Demonstração prática com imagens de teste

📦 1. Instalação e Configuração do Ambiente¶

In [1]:
# Clonar repositório YOLOv5
!git clone https://github.com/ultralytics/yolov5
%cd yolov5
!pip install -r requirements.txt -q
Cloning into 'yolov5'...
remote: Enumerating objects: 17611, done.
remote: Counting objects: 100% (16/16), done.
remote: Compressing objects: 100% (14/14), done.
remote: Total 17611 (delta 8), reused 2 (delta 2), pack-reused 17595 (from 3)
Receiving objects: 100% (17611/17611), 16.84 MiB | 11.63 MiB/s, done.
Resolving deltas: 100% (11984/11984), done.
/content/yolov5
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 31.5 MB/s eta 0:00:00
In [2]:
# Importar bibliotecas necessárias
import torch
import os
from IPython.display import Image, display
import shutil
from datetime import datetime
In [3]:
# Verificar GPU disponível
print(f'Torch version: {torch.__version__}')
print(f'CUDA disponível: {torch.cuda.is_available()}')
print(f'GPU: {torch.cuda.get_device_name(0) if torch.cuda.is_available() else "CPU"}')
Torch version: 2.8.0+cu126
CUDA disponível: False
GPU: CPU

💾 2. Conexão com Google Drive e Organização do Dataset¶

O dataset está organizado da seguinte forma:

/dataset
  /train
    /images (64 imagens: 32 bicicletas + 32 carros)
    /labels (64 arquivos .txt)
  /valid
    /images (8 imagens: 4 bicicletas + 4 carros)
    /labels (8 arquivos .txt)
  /test
    /images (8 imagens: 4 bicicletas + 4 carros)
In [4]:
# Montar Google Drive
from google.colab import drive
drive.mount('/content/drive')
Mounted at /content/drive
In [5]:
# Verificar estrutura do dataset
base_path = '/content/drive/MyDrive/FIAP/FASE_6/dataset'

# Verificar se o caminho existe
if os.path.exists(base_path):
    print("✅ Dataset encontrado!")
    print(f"\n📊 Estrutura do dataset:")

    # Contar imagens em cada pasta
    train_images = len(os.listdir(f'{base_path}/train/images'))
    train_labels = len(os.listdir(f'{base_path}/train/labels'))
    valid_images = len(os.listdir(f'{base_path}/valid/images'))
    valid_labels = len(os.listdir(f'{base_path}/valid/labels'))
    test_images = len(os.listdir(f'{base_path}/test/images'))

    print(f"  Train: {train_images} imagens, {train_labels} labels")
    print(f"  Valid: {valid_images} imagens, {valid_labels} labels")
    print(f"  Test: {test_images} imagens")
else:
    print("❌ Dataset não encontrado!")
    print(f"Verifique o caminho: {base_path}")
✅ Dataset encontrado!

📊 Estrutura do dataset:
  Train: 64 imagens, 64 labels
  Valid: 8 imagens, 8 labels
  Test: 8 imagens

⚙️ 3. Criação do Arquivo de Configuração (dataset.yaml)¶

Este arquivo define:

  • Caminhos das pastas de treino e validação
  • Número de classes (nc = 2)
  • Nomes das classes (bicicleta e carro)
In [6]:
# Criar arquivo dataset.yaml
dataset_yaml_content = f"""
# Dataset configuration for YOLOv5
path: {base_path}  # Caminho raiz do dataset
train: train/images  # Caminho relativo das imagens de treino
val: valid/images    # Caminho relativo das imagens de validação

# Classes
nc: 2  # Número de classes
names: ['bicicleta', 'carro']  # Nomes das classes
"""
# Salvar arquivo yaml
yaml_path = '/content/yolov5/dataset.yaml'
with open(yaml_path, 'w') as f:
    f.write(dataset_yaml_content)

print("✅ Arquivo dataset.yaml criado com sucesso!")
print(f"\n📄 Conteúdo:")
print(dataset_yaml_content)
✅ Arquivo dataset.yaml criado com sucesso!

📄 Conteúdo:

# Dataset configuration for YOLOv5
path: /content/drive/MyDrive/FIAP/FASE_6/dataset  # Caminho raiz do dataset
train: train/images  # Caminho relativo das imagens de treino
val: valid/images    # Caminho relativo das imagens de validação

# Classes
nc: 2  # Número de classes
names: ['bicicleta', 'carro']  # Nomes das classes

🏋️ 4. TREINAMENTO 1: 30 ÉPOCAS¶

Neste primeiro treinamento, vamos treinar o modelo YOLOv5 com 15 épocas.

Parâmetros utilizados:¶

  • img: 640 (tamanho da imagem)
  • batch: 16 (tamanho do lote)
  • epochs: 15
  • data: dataset.yaml (configuração do dataset)
  • weights: yolov5s.pt (pesos pré-treinados do YOLOv5 small)
  • cache: Para acelerar o treinamento
In [7]:
# Treinar modelo com 30 épocas
print("🚀 Iniciando treinamento com 15 épocas...")
print(f"⏰ Início: {datetime.now().strftime('%H:%M:%S')}")

%cd /content/yolov5

!python train.py \
  --img 640 \
  --batch 16 \
  --epochs 15 \
  --data dataset.yaml \
  --weights yolov5s.pt \
  --cache \
  --name treino_15_epocas

print(f"✅ Treinamento finalizado: {datetime.now().strftime('%H:%M:%S')}")
🚀 Iniciando treinamento com 15 épocas...
⏰ Início: 16:16:22
/content/yolov5
Creating new Ultralytics Settings v0.0.6 file ✅ 
View Ultralytics Settings with 'yolo settings' or at '/root/.config/Ultralytics/settings.json'
Update Settings with 'yolo settings key=value', i.e. 'yolo settings runs_dir=path/to/dir'. For help see https://docs.ultralytics.com/quickstart/#ultralytics-settings.
wandb: WARNING ⚠️ wandb is deprecated and will be removed in a future release. See supported integrations at https://github.com/ultralytics/yolov5#integrations.
2025-10-20 16:16:41.163520: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1760977001.190015    8594 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1760977001.198357    8594 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
W0000 00:00:1760977001.218863    8594 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1760977001.218907    8594 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1760977001.218915    8594 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1760977001.218919    8594 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice: (30 second timeout) 3
wandb: You chose "Don't visualize my results"
train: weights=yolov5s.pt, cfg=, data=dataset.yaml, hyp=data/hyps/hyp.scratch-low.yaml, epochs=15, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, evolve_population=data/hyps, resume_evolve=None, bucket=, cache=ram, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs/train, name=treino_15_epocas, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest, ndjson_console=False, ndjson_file=False
github: up to date with https://github.com/ultralytics/yolov5 ✅
YOLOv5 🚀 v7.0-441-g15c0127a Python-3.12.12 torch-2.8.0+cu126 CPU

hyperparameters: lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0
Comet: run 'pip install comet_ml' to automatically track and visualize YOLOv5 🚀 runs in Comet
TensorBoard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/
Downloading https://github.com/ultralytics/assets/releases/download/v0.0.0/Arial.ttf to /root/.config/Ultralytics/Arial.ttf...
100% 755k/755k [00:00<00:00, 23.2MB/s]
Downloading https://github.com/ultralytics/yolov5/releases/download/v7.0/yolov5s.pt to yolov5s.pt...
100% 14.1M/14.1M [00:00<00:00, 222MB/s]

Overriding model.yaml nc=80 with nc=2

                 from  n    params  module                                  arguments                     
  0                -1  1      3520  models.common.Conv                      [3, 32, 6, 2, 2]              
  1                -1  1     18560  models.common.Conv                      [32, 64, 3, 2]                
  2                -1  1     18816  models.common.C3                        [64, 64, 1]                   
  3                -1  1     73984  models.common.Conv                      [64, 128, 3, 2]               
  4                -1  2    115712  models.common.C3                        [128, 128, 2]                 
  5                -1  1    295424  models.common.Conv                      [128, 256, 3, 2]              
  6                -1  3    625152  models.common.C3                        [256, 256, 3]                 
  7                -1  1   1180672  models.common.Conv                      [256, 512, 3, 2]              
  8                -1  1   1182720  models.common.C3                        [512, 512, 1]                 
  9                -1  1    656896  models.common.SPPF                      [512, 512, 5]                 
 10                -1  1    131584  models.common.Conv                      [512, 256, 1, 1]              
 11                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          
 12           [-1, 6]  1         0  models.common.Concat                    [1]                           
 13                -1  1    361984  models.common.C3                        [512, 256, 1, False]          
 14                -1  1     33024  models.common.Conv                      [256, 128, 1, 1]              
 15                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          
 16           [-1, 4]  1         0  models.common.Concat                    [1]                           
 17                -1  1     90880  models.common.C3                        [256, 128, 1, False]          
 18                -1  1    147712  models.common.Conv                      [128, 128, 3, 2]              
 19          [-1, 14]  1         0  models.common.Concat                    [1]                           
 20                -1  1    296448  models.common.C3                        [256, 256, 1, False]          
 21                -1  1    590336  models.common.Conv                      [256, 256, 3, 2]              
 22          [-1, 10]  1         0  models.common.Concat                    [1]                           
 23                -1  1   1182720  models.common.C3                        [512, 512, 1, False]          
 24      [17, 20, 23]  1     18879  models.yolo.Detect                      [2, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]
Model summary: 214 layers, 7025023 parameters, 7025023 gradients, 16.0 GFLOPs

Transferred 343/349 items from yolov5s.pt
optimizer: SGD(lr=0.01) with parameter groups 57 weight(decay=0.0), 60 weight(decay=0.0005), 60 bias
albumentations: 1 validation error for InitSchema
size
  Field required [type=missing, input_value={'scale': (0.8, 1.0), 'ra...: None, 'strict': False}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
train: Scanning /content/drive/MyDrive/FIAP/FASE_6/dataset/train/labels.cache... 64 images, 0 backgrounds, 0 corrupt: 100% 64/64 [00:00<?, ?it/s]
train: Caching images (0.1GB ram): 100% 64/64 [01:02<00:00,  1.02it/s]
val: Scanning /content/drive/MyDrive/FIAP/FASE_6/dataset/valid/labels.cache... 8 images, 0 backgrounds, 0 corrupt: 100% 8/8 [00:00<?, ?it/s]
val: Caching images (0.0GB ram): 100% 8/8 [00:03<00:00,  2.33it/s]

AutoAnchor: 3.81 anchors/target, 1.000 Best Possible Recall (BPR). Current anchors are a good fit to dataset ✅
Plotting labels to runs/train/treino_15_epocas/labels.jpg... 
/content/yolov5/train.py:357: FutureWarning: `torch.cuda.amp.GradScaler(args...)` is deprecated. Please use `torch.amp.GradScaler('cuda', args...)` instead.
  scaler = torch.cuda.amp.GradScaler(enabled=amp)
Image sizes 640 train, 640 val
Using 2 dataloader workers
Logging results to runs/train/treino_15_epocas
Starting training for 15 epochs...

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/14         0G     0.1256    0.03123    0.03523         34        640:  25% 1/4 [00:48<02:24, 48.02s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/14         0G     0.1267    0.03051    0.03385         30        640:  50% 2/4 [01:19<01:16, 38.34s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/14         0G     0.1272    0.03027    0.03243         29        640:  75% 3/4 [01:49<00:34, 34.51s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/14         0G      0.127    0.02986    0.03252         26        640: 100% 4/4 [02:17<00:00, 34.48s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.35s/it]
                   all          8          8    0.00155      0.125    0.00114   0.000447

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/14         0G     0.1157    0.02783    0.02899         24        640:  25% 1/4 [00:28<01:25, 28.54s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/14         0G     0.1184    0.02846    0.03038         28        640:  50% 2/4 [00:56<00:56, 28.28s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/14         0G     0.1181      0.029    0.03129         31        640:  75% 3/4 [01:23<00:27, 27.61s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/14         0G     0.1166    0.02924    0.03062         30        640: 100% 4/4 [01:50<00:00, 27.65s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:05<00:00,  5.55s/it]
                   all          8          8    0.00313       0.25    0.00291   0.000874

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/14         0G     0.1098    0.03044     0.0249         32        640:  25% 1/4 [00:26<01:19, 26.54s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/14         0G     0.1046    0.03051    0.02418         31        640:  50% 2/4 [00:53<00:53, 26.69s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/14         0G     0.1018    0.03188    0.02377         39        640:  75% 3/4 [01:20<00:26, 26.92s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/14         0G    0.09881    0.03152    0.02394         31        640: 100% 4/4 [01:47<00:00, 26.97s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.13s/it]
                   all          8          8    0.00352      0.375    0.00941    0.00344

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/14         0G    0.09139     0.0329    0.02273         37        640:  25% 1/4 [00:26<01:20, 26.77s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/14         0G    0.08161     0.0307    0.02003         24        640:  50% 2/4 [00:53<00:53, 26.90s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/14         0G     0.0791    0.02977    0.02218         27        640:  75% 3/4 [01:20<00:26, 26.63s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/14         0G    0.08213    0.03045     0.0222         36        640: 100% 4/4 [01:46<00:00, 26.67s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.90s/it]
                   all          8          8    0.00348       0.25     0.0207     0.0104

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/14         0G    0.09387    0.03083    0.02479         34        640:  25% 1/4 [00:26<01:19, 26.42s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/14         0G    0.08957    0.03002    0.02191         30        640:  50% 2/4 [00:53<00:53, 26.82s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/14         0G    0.08423    0.03067    0.02037         38        640:  75% 3/4 [01:21<00:27, 27.47s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/14         0G    0.08239    0.02977    0.02055         29        640: 100% 4/4 [01:48<00:00, 27.11s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.71s/it]
                   all          8          8    0.00349      0.375     0.0777     0.0387

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/14         0G    0.06804    0.03374     0.0181         37        640:  25% 1/4 [00:27<01:22, 27.55s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/14         0G    0.07521    0.03144    0.01882         33        640:  50% 2/4 [00:57<00:58, 29.05s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/14         0G     0.0767    0.03156    0.01956         41        640:  75% 3/4 [01:26<00:28, 28.91s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/14         0G    0.07657    0.03208    0.01932         38        640: 100% 4/4 [01:53<00:00, 28.27s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.92s/it]
                   all          8          8    0.00334        0.5      0.294      0.151

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/14         0G    0.07853    0.03218    0.01842         39        640:  25% 1/4 [00:27<01:21, 27.14s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/14         0G    0.07995    0.03169    0.01704         40        640:  50% 2/4 [00:53<00:53, 26.90s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/14         0G    0.07989    0.02987     0.0171         30        640:  75% 3/4 [01:21<00:27, 27.25s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/14         0G    0.07666    0.02919    0.01815         30        640: 100% 4/4 [01:47<00:00, 26.93s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.80s/it]
                   all          8          8    0.00331      0.375      0.137     0.0734

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/14         0G    0.06857    0.03056    0.01508         36        640:  25% 1/4 [00:26<01:19, 26.54s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/14         0G     0.0727    0.02972    0.01793         39        640:  50% 2/4 [00:53<00:54, 27.01s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/14         0G    0.07317    0.02906    0.01778         32        640:  75% 3/4 [01:22<00:27, 27.74s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/14         0G    0.07315    0.02907    0.01802         38        640: 100% 4/4 [01:49<00:00, 27.32s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.88s/it]
                   all          8          8     0.0658      0.625      0.421      0.203

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/14         0G    0.07486    0.03096    0.01938         39        640:  25% 1/4 [00:27<01:21, 27.17s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/14         0G    0.07616     0.0271    0.01692         30        640:  50% 2/4 [00:54<00:54, 27.15s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/14         0G    0.07259    0.02802    0.01684         38        640:  75% 3/4 [01:22<00:27, 27.41s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/14         0G    0.07182    0.02732     0.0161         31        640: 100% 4/4 [01:48<00:00, 27.15s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.51s/it]
                   all          8          8     0.0105        0.5      0.269      0.141

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/14         0G    0.06313    0.02721     0.0169         35        640:  25% 1/4 [00:26<01:20, 26.92s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/14         0G    0.06388    0.02994    0.01434         44        640:  50% 2/4 [00:54<00:54, 27.25s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/14         0G    0.06253    0.02914    0.01535         35        640:  75% 3/4 [01:23<00:28, 28.20s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/14         0G    0.06236    0.02733    0.01476         27        640: 100% 4/4 [01:51<00:00, 27.90s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.85s/it]
                   all          8          8      0.767      0.484      0.652      0.392

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/14         0G    0.06493    0.03065    0.01436         39        640:  25% 1/4 [00:27<01:23, 27.77s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/14         0G    0.07064    0.02639    0.01595         28        640:  50% 2/4 [00:55<00:55, 27.69s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/14         0G    0.06777    0.02661    0.01541         33        640:  75% 3/4 [01:23<00:27, 27.89s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/14         0G    0.06365    0.02523    0.01429         27        640: 100% 4/4 [01:54<00:00, 28.50s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.89s/it]
                   all          8          8      0.573      0.625      0.721      0.395

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/14         0G    0.06045    0.03093    0.01738         43        640:  25% 1/4 [00:27<01:23, 27.87s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/14         0G    0.05999    0.02862    0.01447         34        640:  50% 2/4 [00:54<00:53, 27.00s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/14         0G    0.06223    0.02631    0.01348         29        640:  75% 3/4 [01:22<00:27, 27.68s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/14         0G    0.06261    0.02618    0.01406         36        640: 100% 4/4 [01:48<00:00, 27.24s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.93s/it]
                   all          8          8      0.606      0.625      0.666       0.36

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/14         0G    0.05826    0.02249    0.00969         28        640:  25% 1/4 [00:26<01:18, 26.27s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/14         0G    0.06474     0.0232    0.01208         32        640:  50% 2/4 [00:53<00:53, 26.62s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/14         0G    0.06496    0.02332    0.01259         30        640:  75% 3/4 [01:21<00:27, 27.50s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/14         0G    0.06266    0.02356    0.01255         33        640: 100% 4/4 [01:49<00:00, 27.28s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.84s/it]
                   all          8          8      0.808      0.875       0.92      0.471

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/14         0G    0.06822    0.02777    0.01556         40        640:  25% 1/4 [00:27<01:23, 27.89s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/14         0G    0.06371    0.02577    0.01287         32        640:  50% 2/4 [00:56<00:56, 28.10s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/14         0G    0.06062    0.02516    0.01186         32        640:  75% 3/4 [01:23<00:27, 27.78s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/14         0G    0.06319    0.02415    0.01381         28        640: 100% 4/4 [01:55<00:00, 28.95s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.84s/it]
                   all          8          8      0.717       0.75      0.863      0.466

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/14         0G    0.05416    0.02748   0.009614         39        640:  25% 1/4 [00:27<01:21, 27.17s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/14         0G    0.06113    0.02551    0.01132         35        640:  50% 2/4 [00:54<00:54, 27.38s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/14         0G     0.0647    0.02451    0.01316         34        640:  75% 3/4 [01:23<00:28, 28.16s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/14         0G    0.06033    0.02312    0.01338         25        640: 100% 4/4 [01:52<00:00, 28.20s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.11s/it]
                   all          8          8       0.88      0.875       0.92      0.576

15 epochs completed in 0.487 hours.
Optimizer stripped from runs/train/treino_15_epocas/weights/last.pt, 14.4MB
Optimizer stripped from runs/train/treino_15_epocas/weights/best.pt, 14.4MB

Validating runs/train/treino_15_epocas/weights/best.pt...
Fusing layers... 
Model summary: 157 layers, 7015519 parameters, 0 gradients, 15.8 GFLOPs
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.61s/it]
                   all          8          8      0.878      0.875       0.92      0.576
             bicicleta          8          4      0.833       0.75      0.845      0.514
                 carro          8          4      0.922          1      0.995      0.638
Results saved to runs/train/treino_15_epocas
✅ Treinamento finalizado: 16:48:29

📊 Análise dos Resultados - 15 Épocas¶

Vamos visualizar as métricas de treinamento e alguns resultados.

In [8]:
# Visualizar gráfico de resultados do treino (15 épocas)
print("📈 Gráfico de métricas de treinamento (15 épocas):")
display(Image(filename='/content/yolov5/runs/train/treino_15_epocas/results.png'))
📈 Gráfico de métricas de treinamento (15 épocas):
No description has been provided for this image
In [9]:
# Visualizar exemplos de predições no conjunto de validação
print("🔍 Exemplos de predições no conjunto de validação (15 épocas):")
display(Image(filename='/content/yolov5/runs/train/treino_15_epocas/val_batch0_pred.jpg'))
🔍 Exemplos de predições no conjunto de validação (15 épocas):
No description has been provided for this image
In [10]:
# Visualizar matriz de confusão
print("📊 Matriz de Confusão (15 épocas):")
display(Image(filename='/content/yolov5/runs/train/treino_15_epocas/confusion_matrix.png'))
📊 Matriz de Confusão (15 épocas):
No description has been provided for this image

🏋️ 5. TREINAMENTO 2: 35 ÉPOCAS¶

Agora vamos treinar o mesmo modelo com 40 épocas para comparar os resultados.

Hipótese:¶

Com mais épocas, o modelo deve ter:

  • ✅ Maior acurácia (mAP)
  • ✅ Menor loss (erro)
  • ⚠️ Maior tempo de treinamento
  • ⚠️ Possível overfitting (se não houver validação adequada)
In [11]:
# Treinar modelo com 40 épocas
print("🚀 Iniciando treinamento com 40 épocas...")
print(f"⏰ Início: {datetime.now().strftime('%H:%M:%S')}")

!python train.py \
  --img 640 \
  --batch 16 \
  --epochs 40 \
  --data dataset.yaml \
  --weights yolov5s.pt \
  --cache \
  --name treino_40_epocas

print(f"✅ Treinamento finalizado: {datetime.now().strftime('%H:%M:%S')}")
🚀 Iniciando treinamento com 40 épocas...
⏰ Início: 16:48:29
wandb: WARNING ⚠️ wandb is deprecated and will be removed in a future release. See supported integrations at https://github.com/ultralytics/yolov5#integrations.
2025-10-20 16:48:43.396880: E external/local_xla/xla/stream_executor/cuda/cuda_fft.cc:467] Unable to register cuFFT factory: Attempting to register factory for plugin cuFFT when one has already been registered
WARNING: All log messages before absl::InitializeLog() is called are written to STDERR
E0000 00:00:1760978923.428247   16394 cuda_dnn.cc:8579] Unable to register cuDNN factory: Attempting to register factory for plugin cuDNN when one has already been registered
E0000 00:00:1760978923.437746   16394 cuda_blas.cc:1407] Unable to register cuBLAS factory: Attempting to register factory for plugin cuBLAS when one has already been registered
W0000 00:00:1760978923.472006   16394 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1760978923.472062   16394 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1760978923.472067   16394 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
W0000 00:00:1760978923.472073   16394 computation_placer.cc:177] computation placer already registered. Please check linkage and avoid linking the same target more than once.
wandb: (1) Create a W&B account
wandb: (2) Use an existing W&B account
wandb: (3) Don't visualize my results
wandb: Enter your choice: (30 second timeout) 
wandb: W&B disabled due to login timeout.
train: weights=yolov5s.pt, cfg=, data=dataset.yaml, hyp=data/hyps/hyp.scratch-low.yaml, epochs=40, batch_size=16, imgsz=640, rect=False, resume=False, nosave=False, noval=False, noautoanchor=False, noplots=False, evolve=None, evolve_population=data/hyps, resume_evolve=None, bucket=, cache=ram, image_weights=False, device=, multi_scale=False, single_cls=False, optimizer=SGD, sync_bn=False, workers=8, project=runs/train, name=treino_40_epocas, exist_ok=False, quad=False, cos_lr=False, label_smoothing=0.0, patience=100, freeze=[0], save_period=-1, seed=0, local_rank=-1, entity=None, upload_dataset=False, bbox_interval=-1, artifact_alias=latest, ndjson_console=False, ndjson_file=False
github: up to date with https://github.com/ultralytics/yolov5 ✅
YOLOv5 🚀 v7.0-441-g15c0127a Python-3.12.12 torch-2.8.0+cu126 CPU

hyperparameters: lr0=0.01, lrf=0.01, momentum=0.937, weight_decay=0.0005, warmup_epochs=3.0, warmup_momentum=0.8, warmup_bias_lr=0.1, box=0.05, cls=0.5, cls_pw=1.0, obj=1.0, obj_pw=1.0, iou_t=0.2, anchor_t=4.0, fl_gamma=0.0, hsv_h=0.015, hsv_s=0.7, hsv_v=0.4, degrees=0.0, translate=0.1, scale=0.5, shear=0.0, perspective=0.0, flipud=0.0, fliplr=0.5, mosaic=1.0, mixup=0.0, copy_paste=0.0
Comet: run 'pip install comet_ml' to automatically track and visualize YOLOv5 🚀 runs in Comet
TensorBoard: Start with 'tensorboard --logdir runs/train', view at http://localhost:6006/
Overriding model.yaml nc=80 with nc=2

                 from  n    params  module                                  arguments                     
  0                -1  1      3520  models.common.Conv                      [3, 32, 6, 2, 2]              
  1                -1  1     18560  models.common.Conv                      [32, 64, 3, 2]                
  2                -1  1     18816  models.common.C3                        [64, 64, 1]                   
  3                -1  1     73984  models.common.Conv                      [64, 128, 3, 2]               
  4                -1  2    115712  models.common.C3                        [128, 128, 2]                 
  5                -1  1    295424  models.common.Conv                      [128, 256, 3, 2]              
  6                -1  3    625152  models.common.C3                        [256, 256, 3]                 
  7                -1  1   1180672  models.common.Conv                      [256, 512, 3, 2]              
  8                -1  1   1182720  models.common.C3                        [512, 512, 1]                 
  9                -1  1    656896  models.common.SPPF                      [512, 512, 5]                 
 10                -1  1    131584  models.common.Conv                      [512, 256, 1, 1]              
 11                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          
 12           [-1, 6]  1         0  models.common.Concat                    [1]                           
 13                -1  1    361984  models.common.C3                        [512, 256, 1, False]          
 14                -1  1     33024  models.common.Conv                      [256, 128, 1, 1]              
 15                -1  1         0  torch.nn.modules.upsampling.Upsample    [None, 2, 'nearest']          
 16           [-1, 4]  1         0  models.common.Concat                    [1]                           
 17                -1  1     90880  models.common.C3                        [256, 128, 1, False]          
 18                -1  1    147712  models.common.Conv                      [128, 128, 3, 2]              
 19          [-1, 14]  1         0  models.common.Concat                    [1]                           
 20                -1  1    296448  models.common.C3                        [256, 256, 1, False]          
 21                -1  1    590336  models.common.Conv                      [256, 256, 3, 2]              
 22          [-1, 10]  1         0  models.common.Concat                    [1]                           
 23                -1  1   1182720  models.common.C3                        [512, 512, 1, False]          
 24      [17, 20, 23]  1     18879  models.yolo.Detect                      [2, [[10, 13, 16, 30, 33, 23], [30, 61, 62, 45, 59, 119], [116, 90, 156, 198, 373, 326]], [128, 256, 512]]
Model summary: 214 layers, 7025023 parameters, 7025023 gradients, 16.0 GFLOPs

Transferred 343/349 items from yolov5s.pt
optimizer: SGD(lr=0.01) with parameter groups 57 weight(decay=0.0), 60 weight(decay=0.0005), 60 bias
albumentations: 1 validation error for InitSchema
size
  Field required [type=missing, input_value={'scale': (0.8, 1.0), 'ra...: None, 'strict': False}, input_type=dict]
    For further information visit https://errors.pydantic.dev/2.11/v/missing
train: Scanning /content/drive/MyDrive/FIAP/FASE_6/dataset/train/labels.cache... 64 images, 0 backgrounds, 0 corrupt: 100% 64/64 [00:00<?, ?it/s]
train: Caching images (0.1GB ram): 100% 64/64 [00:00<00:00, 88.88it/s]
val: Scanning /content/drive/MyDrive/FIAP/FASE_6/dataset/valid/labels.cache... 8 images, 0 backgrounds, 0 corrupt: 100% 8/8 [00:00<?, ?it/s]
val: Caching images (0.0GB ram): 100% 8/8 [00:00<00:00, 66.97it/s]

AutoAnchor: 3.81 anchors/target, 1.000 Best Possible Recall (BPR). Current anchors are a good fit to dataset ✅
Plotting labels to runs/train/treino_40_epocas/labels.jpg... 
/content/yolov5/train.py:357: FutureWarning: `torch.cuda.amp.GradScaler(args...)` is deprecated. Please use `torch.amp.GradScaler('cuda', args...)` instead.
  scaler = torch.cuda.amp.GradScaler(enabled=amp)
Image sizes 640 train, 640 val
Using 2 dataloader workers
Logging results to runs/train/treino_40_epocas
Starting training for 40 epochs...

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/39         0G     0.1256    0.03123    0.03523         34        640:  25% 1/4 [00:45<02:15, 45.28s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/39         0G     0.1267    0.03051    0.03385         30        640:  50% 2/4 [01:19<01:17, 38.85s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/39         0G     0.1272    0.03027    0.03243         29        640:  75% 3/4 [01:47<00:33, 33.91s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       0/39         0G      0.127    0.02986    0.03252         26        640: 100% 4/4 [02:15<00:00, 33.90s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:05<00:00,  5.25s/it]
                   all          8          8    0.00321      0.125    0.00244   0.000968

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/39         0G     0.1157    0.02783    0.02899         24        640:  25% 1/4 [00:29<01:29, 29.90s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/39         0G     0.1184    0.02846    0.03036         28        640:  50% 2/4 [00:57<00:56, 28.47s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/39         0G      0.118    0.02901    0.03123         31        640:  75% 3/4 [01:23<00:27, 27.51s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       1/39         0G     0.1164    0.02926    0.03052         30        640: 100% 4/4 [01:52<00:00, 28.13s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:08<00:00,  8.41s/it]
                   all          8          8    0.00323      0.125    0.00248   0.000743

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/39         0G     0.1091    0.03049    0.02472         32        640:  25% 1/4 [00:31<01:35, 31.69s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/39         0G     0.1035    0.03057    0.02398         31        640:  50% 2/4 [00:57<00:56, 28.50s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/39         0G     0.1007    0.03196    0.02358         39        640:  75% 3/4 [01:25<00:28, 28.09s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       2/39         0G    0.09784    0.03159    0.02374         31        640: 100% 4/4 [01:52<00:00, 28.24s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.16s/it]
                   all          8          8     0.0036      0.375     0.0112    0.00371

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/39         0G    0.09088    0.03291     0.0227         37        640:  25% 1/4 [00:26<01:20, 26.93s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/39         0G    0.08113    0.03067    0.01992         24        640:  50% 2/4 [00:54<00:54, 27.07s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/39         0G    0.07854    0.02969     0.0221         27        640:  75% 3/4 [01:21<00:27, 27.20s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       3/39         0G    0.08158    0.03034    0.02206         36        640: 100% 4/4 [01:47<00:00, 26.79s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:05<00:00,  5.53s/it]
                   all          8          8    0.00358      0.375     0.0699     0.0348

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/39         0G    0.09277    0.03064    0.02459         34        640:  25% 1/4 [00:29<01:29, 29.67s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/39         0G    0.08859    0.02977    0.02162         30        640:  50% 2/4 [00:56<00:56, 28.27s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/39         0G    0.08335    0.03042    0.02008         38        640:  75% 3/4 [01:24<00:28, 28.04s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       4/39         0G    0.08155    0.02954    0.02022         29        640: 100% 4/4 [01:52<00:00, 28.03s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.07s/it]
                   all          8          8    0.00356        0.5      0.262      0.144

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/39         0G    0.06684    0.03345    0.01782         37        640:  25% 1/4 [00:27<01:22, 27.48s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/39         0G    0.07387    0.03117    0.01807         33        640:  50% 2/4 [00:58<00:59, 29.78s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/39         0G    0.07506    0.03132    0.01888         41        640:  75% 3/4 [01:27<00:29, 29.28s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       5/39         0G    0.07544    0.03173    0.01852         38        640: 100% 4/4 [01:53<00:00, 28.50s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.84s/it]
                   all          8          8    0.00327        0.5      0.295      0.154

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/39         0G    0.07764    0.03153    0.01825         39        640:  25% 1/4 [00:26<01:20, 26.79s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/39         0G    0.07772    0.03123    0.01653         40        640:  50% 2/4 [00:54<00:54, 27.13s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/39         0G    0.07579    0.02939    0.01657         30        640:  75% 3/4 [01:22<00:27, 27.50s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       6/39         0G    0.07241    0.02868    0.01781         30        640: 100% 4/4 [01:49<00:00, 27.30s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.95s/it]
                   all          8          8     0.0284      0.625       0.42      0.199

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/39         0G    0.06677    0.02995    0.01402         36        640:  25% 1/4 [00:27<01:22, 27.45s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/39         0G    0.07024    0.02909    0.01682         39        640:  50% 2/4 [00:55<00:55, 27.65s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/39         0G    0.07128    0.02829    0.01671         32        640:  75% 3/4 [01:22<00:27, 27.25s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       7/39         0G    0.07146    0.02813    0.01718         38        640: 100% 4/4 [01:49<00:00, 27.30s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.79s/it]
                   all          8          8      0.315      0.375      0.392      0.218

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/39         0G    0.07274     0.0296    0.01874         39        640:  25% 1/4 [00:26<01:20, 26.94s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/39         0G    0.07232     0.0259    0.01631         30        640:  50% 2/4 [00:54<00:54, 27.31s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/39         0G    0.06922    0.02675    0.01567         38        640:  75% 3/4 [01:22<00:27, 27.79s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       8/39         0G    0.06897    0.02596     0.0149         31        640: 100% 4/4 [01:50<00:00, 27.68s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.76s/it]
                   all          8          8      0.774      0.506      0.654      0.404

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/39         0G    0.06048    0.02548    0.01414         35        640:  25% 1/4 [00:26<01:20, 26.76s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/39         0G    0.06044    0.02807    0.01212         44        640:  50% 2/4 [00:54<00:54, 27.45s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/39         0G    0.05967    0.02729    0.01307         35        640:  75% 3/4 [01:21<00:27, 27.20s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
       9/39         0G    0.06029    0.02532    0.01251         27        640: 100% 4/4 [01:48<00:00, 27.01s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95:   0% 0/1 [00:00<?, ?it/s]WARNING ⚠️ NMS time limit 0.900s exceeded
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.96s/it]
                   all          8          8      0.441      0.625      0.549      0.283

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/39         0G    0.06632     0.0276    0.01184         39        640:  25% 1/4 [00:27<01:21, 27.20s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/39         0G     0.0707     0.0237    0.01233         28        640:  50% 2/4 [00:54<00:54, 27.45s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/39         0G    0.06791    0.02375    0.01207         33        640:  75% 3/4 [01:26<00:29, 29.29s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      10/39         0G    0.06457    0.02228    0.01134         27        640: 100% 4/4 [01:53<00:00, 28.42s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.65s/it]
                   all          8          8      0.898       0.75      0.854       0.46

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/39         0G    0.06159    0.02662    0.01439         43        640:  25% 1/4 [00:27<01:23, 27.87s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/39         0G    0.05935    0.02505    0.01163         34        640:  50% 2/4 [00:54<00:54, 27.27s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/39         0G    0.06062    0.02324     0.0108         29        640:  75% 3/4 [01:23<00:27, 27.90s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      11/39         0G    0.06165     0.0231    0.01128         36        640: 100% 4/4 [01:49<00:00, 27.47s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.66s/it]
                   all          8          8      0.825      0.822      0.858      0.369

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/39         0G    0.05951     0.0195   0.007279         28        640:  25% 1/4 [00:26<01:20, 26.86s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/39         0G    0.06709    0.01976   0.009518         32        640:  50% 2/4 [00:53<00:53, 26.54s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/39         0G    0.06584    0.02001    0.01011         30        640:  75% 3/4 [01:22<00:27, 27.95s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      12/39         0G    0.06411    0.01999    0.01011         33        640: 100% 4/4 [01:49<00:00, 27.46s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.35s/it]
                   all          8          8      0.923      0.875      0.915      0.579

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/39         0G    0.06866    0.02378    0.01207         40        640:  25% 1/4 [00:26<01:19, 26.53s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/39         0G    0.06444    0.02149    0.01014         32        640:  50% 2/4 [00:55<00:55, 27.89s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/39         0G    0.06425    0.02093   0.009063         32        640:  75% 3/4 [01:21<00:27, 27.28s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      13/39         0G    0.06791    0.01996    0.01085         28        640: 100% 4/4 [01:48<00:00, 27.09s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.40s/it]
                   all          8          8      0.169      0.894      0.228      0.121

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/39         0G    0.05983    0.02323    0.00673         39        640:  25% 1/4 [00:25<01:16, 25.49s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/39         0G     0.0623    0.02146    0.00849         35        640:  50% 2/4 [00:51<00:51, 25.70s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/39         0G    0.06299    0.02071   0.009687         34        640:  75% 3/4 [01:18<00:26, 26.54s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      14/39         0G    0.05861    0.01949   0.009315         25        640: 100% 4/4 [01:46<00:00, 26.69s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.22s/it]
                   all          8          8      0.687          1      0.808      0.442

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      15/39         0G    0.05434    0.01905   0.005311         33        640:  25% 1/4 [00:26<01:19, 26.42s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      15/39         0G    0.05827     0.0188   0.005822         34        640:  50% 2/4 [00:54<00:55, 27.57s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      15/39         0G    0.05913    0.01989   0.007395         38        640:  75% 3/4 [01:21<00:27, 27.32s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      15/39         0G    0.05776    0.02049   0.006868         41        640: 100% 4/4 [01:48<00:00, 27.04s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.67s/it]
                   all          8          8      0.645      0.875      0.922      0.423

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      16/39         0G    0.06076    0.01779   0.007256         32        640:  25% 1/4 [00:30<01:31, 30.43s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      16/39         0G    0.06141    0.01892   0.007303         38        640:  50% 2/4 [00:58<00:58, 29.30s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      16/39         0G     0.0659    0.01755   0.009285         28        640:  75% 3/4 [01:26<00:28, 28.40s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      16/39         0G    0.06441    0.01808   0.008683         38        640: 100% 4/4 [01:54<00:00, 28.57s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.16s/it]
                   all          8          8      0.695          1       0.87      0.458

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      17/39         0G     0.0587    0.01957   0.005002         36        640:  25% 1/4 [00:26<01:19, 26.65s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      17/39         0G    0.05637    0.01879   0.004963         36        640:  50% 2/4 [00:53<00:53, 26.63s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      17/39         0G    0.05936    0.01829    0.00589         33        640:  75% 3/4 [01:20<00:26, 26.78s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      17/39         0G    0.06001    0.01737   0.006168         25        640: 100% 4/4 [01:47<00:00, 26.99s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.58s/it]
                   all          8          8      0.973      0.867      0.941      0.337

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      18/39         0G    0.05839    0.01863   0.007206         36        640:  25% 1/4 [00:26<01:19, 26.38s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      18/39         0G    0.06197     0.0191   0.007979         41        640:  50% 2/4 [00:55<00:55, 27.75s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      18/39         0G    0.06264     0.0184   0.006928         34        640:  75% 3/4 [01:23<00:28, 28.20s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      18/39         0G     0.0635    0.01793   0.007017         31        640: 100% 4/4 [01:50<00:00, 27.70s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.05s/it]
                   all          8          8      0.792      0.619       0.79      0.276

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      19/39         0G    0.07101    0.01465   0.004276         30        640:  25% 1/4 [00:27<01:21, 27.22s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      19/39         0G    0.06948    0.01427    0.00418         24        640:  50% 2/4 [00:56<00:56, 28.24s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      19/39         0G    0.06523     0.0161   0.005904         41        640:  75% 3/4 [01:22<00:27, 27.27s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      19/39         0G    0.06273    0.01586   0.006118         28        640: 100% 4/4 [01:50<00:00, 27.67s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.57s/it]
                   all          8          8       0.89      0.838      0.953      0.688

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      20/39         0G    0.05421     0.0177   0.004143         33        640:  25% 1/4 [00:26<01:19, 26.49s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      20/39         0G    0.05569    0.01899   0.004246         40        640:  50% 2/4 [00:53<00:53, 26.66s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      20/39         0G    0.05754    0.01861   0.005261         36        640:  75% 3/4 [01:20<00:27, 27.06s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      20/39         0G    0.05183    0.01778   0.004818         31        640: 100% 4/4 [01:49<00:00, 27.26s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.02s/it]
                   all          8          8      0.864      0.865      0.916      0.644

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      21/39         0G    0.05756    0.01657   0.004643         32        640:  25% 1/4 [00:27<01:23, 27.89s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      21/39         0G    0.05919    0.01564   0.003861         31        640:  50% 2/4 [00:55<00:55, 27.99s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      21/39         0G    0.05986    0.01612   0.004192         37        640:  75% 3/4 [01:25<00:28, 28.88s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      21/39         0G    0.06057    0.01611   0.004262         35        640: 100% 4/4 [01:52<00:00, 28.21s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.43s/it]
                   all          8          8      0.535       0.75      0.708      0.497

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      22/39         0G    0.06287    0.01575   0.003479         34        640:  25% 1/4 [00:26<01:20, 26.76s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      22/39         0G    0.05975    0.01621    0.00375         37        640:  50% 2/4 [00:53<00:53, 26.60s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      22/39         0G    0.05781    0.01505   0.003552         26        640:  75% 3/4 [01:20<00:27, 27.08s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      22/39         0G    0.05823    0.01496   0.004222         27        640: 100% 4/4 [01:49<00:00, 27.32s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.97s/it]
                   all          8          8      0.939      0.875      0.941       0.62

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      23/39         0G    0.05566    0.01995   0.007277         40        640:  25% 1/4 [00:27<01:21, 27.13s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      23/39         0G    0.05664    0.01903   0.006923         38        640:  50% 2/4 [00:55<00:55, 27.82s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      23/39         0G    0.05165    0.01766   0.005838         29        640:  75% 3/4 [01:23<00:27, 27.78s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      23/39         0G    0.05308    0.01699   0.005561         29        640: 100% 4/4 [01:51<00:00, 27.80s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.00s/it]
                   all          8          8      0.617       0.75      0.702      0.445

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      24/39         0G     0.0541    0.01371   0.002871         30        640:  25% 1/4 [00:26<01:20, 26.88s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      24/39         0G    0.05703    0.01542   0.003299         36        640:  50% 2/4 [00:54<00:54, 27.36s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      24/39         0G    0.05807    0.01644   0.004296         41        640:  75% 3/4 [01:21<00:27, 27.26s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      24/39         0G    0.05958     0.0159   0.004114         33        640: 100% 4/4 [01:49<00:00, 27.50s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.38s/it]
                   all          8          8      0.903      0.875      0.933      0.538

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      25/39         0G     0.0522    0.01511   0.002875         33        640:  25% 1/4 [00:27<01:21, 27.11s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      25/39         0G    0.05449    0.01618   0.004479         34        640:  50% 2/4 [00:55<00:55, 27.87s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      25/39         0G     0.0545    0.01662   0.004615         36        640:  75% 3/4 [01:23<00:27, 27.93s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      25/39         0G    0.05397     0.0163   0.004767         30        640: 100% 4/4 [01:50<00:00, 27.71s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.93s/it]
                   all          8          8      0.728      0.875      0.857      0.586

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      26/39         0G    0.05362    0.01849   0.004678         37        640:  25% 1/4 [00:27<01:22, 27.52s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      26/39         0G    0.05234    0.01811    0.00568         37        640:  50% 2/4 [00:55<00:55, 27.90s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      26/39         0G    0.05309    0.01763   0.005449         34        640:  75% 3/4 [01:22<00:27, 27.55s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      26/39         0G     0.0516    0.01665   0.004941         30        640: 100% 4/4 [01:49<00:00, 27.45s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.02s/it]
                   all          8          8      0.905      0.875      0.926       0.59

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      27/39         0G    0.04994    0.01323    0.00385         31        640:  25% 1/4 [00:33<01:41, 33.78s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      27/39         0G    0.05481    0.01383   0.004324         32        640:  50% 2/4 [01:01<01:00, 30.25s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      27/39         0G    0.05288    0.01399   0.003784         31        640:  75% 3/4 [01:28<00:28, 28.93s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      27/39         0G    0.05281    0.01466     0.0036         37        640: 100% 4/4 [01:56<00:00, 29.06s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.90s/it]
                   all          8          8      0.863      0.875      0.941      0.681

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      28/39         0G    0.04644    0.01408   0.002826         28        640:  25% 1/4 [00:26<01:20, 26.69s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      28/39         0G    0.04648    0.01471   0.003315         35        640:  50% 2/4 [00:57<00:58, 29.26s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      28/39         0G    0.04743    0.01586   0.004018         36        640:  75% 3/4 [01:24<00:28, 28.21s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      28/39         0G    0.04765    0.01533   0.005307         30        640: 100% 4/4 [01:50<00:00, 27.71s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.95s/it]
                   all          8          8      0.892      0.875       0.97      0.746

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      29/39         0G    0.04652    0.01876   0.004169         39        640:  25% 1/4 [00:25<01:17, 25.74s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      29/39         0G    0.04956    0.01686    0.00422         30        640:  50% 2/4 [00:52<00:52, 26.36s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      29/39         0G    0.04678    0.01661   0.003628         31        640:  75% 3/4 [01:20<00:26, 26.93s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      29/39         0G     0.0443    0.01569   0.003496         26        640: 100% 4/4 [01:47<00:00, 26.83s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.96s/it]
                   all          8          8      0.814      0.875      0.953      0.486

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      30/39         0G    0.05677    0.01579    0.00356         37        640:  25% 1/4 [00:26<01:20, 26.77s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      30/39         0G    0.05387    0.01481   0.003214         31        640:  50% 2/4 [00:54<00:54, 27.05s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      30/39         0G    0.05184    0.01443   0.002716         31        640:  75% 3/4 [01:20<00:26, 26.86s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      30/39         0G    0.05201    0.01546   0.003304         39        640: 100% 4/4 [01:47<00:00, 26.94s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.94s/it]
                   all          8          8      0.904      0.893      0.995      0.755

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      31/39         0G     0.0481    0.01726   0.004034         38        640:  25% 1/4 [00:26<01:20, 26.70s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      31/39         0G     0.0475    0.01818   0.003907         40        640:  50% 2/4 [00:55<00:56, 28.03s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      31/39         0G    0.04591    0.01758   0.003678         35        640:  75% 3/4 [01:23<00:27, 27.76s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      31/39         0G    0.04535    0.01645   0.003507         28        640: 100% 4/4 [01:50<00:00, 27.58s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.19s/it]
                   all          8          8      0.988      0.897      0.995      0.715

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      32/39         0G    0.04321    0.01355   0.003011         33        640:  25% 1/4 [00:25<01:17, 25.82s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      32/39         0G    0.04408    0.01333   0.003337         33        640:  50% 2/4 [00:56<00:57, 28.87s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      32/39         0G    0.04244     0.0145   0.002983         37        640:  75% 3/4 [01:23<00:28, 28.09s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      32/39         0G    0.04521    0.01568   0.003275         42        640: 100% 4/4 [01:51<00:00, 27.87s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.93s/it]
                   all          8          8      0.867      0.841      0.941      0.701

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      33/39         0G    0.04022    0.01716    0.00217         38        640:  25% 1/4 [00:26<01:19, 26.48s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      33/39         0G    0.04293     0.0178   0.002888         40        640:  50% 2/4 [00:54<00:54, 27.36s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      33/39         0G    0.04611    0.01624   0.004394         33        640:  75% 3/4 [01:22<00:27, 27.51s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      33/39         0G    0.04728    0.01624   0.004526         40        640: 100% 4/4 [01:50<00:00, 27.68s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.89s/it]
                   all          8          8      0.956      0.983      0.995      0.708

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      34/39         0G    0.05041    0.01402    0.01012         32        640:  25% 1/4 [00:26<01:18, 26.11s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      34/39         0G    0.04607     0.0155   0.006527         36        640:  50% 2/4 [00:51<00:51, 25.90s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      34/39         0G    0.04331    0.01495   0.005127         31        640:  75% 3/4 [01:19<00:26, 26.64s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      34/39         0G    0.04343    0.01578   0.004861         40        640: 100% 4/4 [01:47<00:00, 26.79s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.88s/it]
                   all          8          8      0.966      0.981      0.995      0.732

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      35/39         0G    0.04079    0.01288   0.001574         30        640:  25% 1/4 [00:26<01:19, 26.64s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      35/39         0G    0.04164    0.01371   0.002073         34        640:  50% 2/4 [00:54<00:54, 27.36s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      35/39         0G    0.03978    0.01438   0.002213         37        640:  75% 3/4 [01:20<00:26, 26.82s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      35/39         0G    0.03897    0.01411   0.002119         34        640: 100% 4/4 [01:48<00:00, 27.05s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:04<00:00,  4.43s/it]
                   all          8          8      0.977      0.983      0.995      0.798

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      36/39         0G    0.04518    0.01376   0.005489         32        640:  25% 1/4 [00:25<01:16, 25.45s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      36/39         0G    0.04377    0.01326   0.004206         28        640:  50% 2/4 [00:53<00:53, 26.89s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      36/39         0G    0.04344    0.01342   0.003941         31        640:  75% 3/4 [01:20<00:27, 27.22s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      36/39         0G    0.04264    0.01333   0.003694         26        640: 100% 4/4 [01:48<00:00, 27.17s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:08<00:00,  8.37s/it]
                   all          8          8      0.983      0.987      0.995       0.76

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      37/39         0G    0.03653     0.0166   0.002384         38        640:  25% 1/4 [00:26<01:19, 26.58s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      37/39         0G    0.03905    0.01406    0.00339         28        640:  50% 2/4 [00:54<00:54, 27.26s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      37/39         0G    0.04223    0.01455   0.003688         38        640:  75% 3/4 [01:22<00:27, 27.53s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      37/39         0G    0.04019    0.01436   0.003357         31        640: 100% 4/4 [01:49<00:00, 27.37s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  3.00s/it]
                   all          8          8      0.985      0.995      0.995      0.745

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      38/39         0G    0.04213      0.012   0.002828         25        640:  25% 1/4 [00:25<01:17, 25.76s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      38/39         0G    0.03804    0.01334   0.003039         34        640:  50% 2/4 [00:51<00:51, 25.79s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      38/39         0G     0.0385    0.01489    0.00336         44        640:  75% 3/4 [01:18<00:26, 26.20s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      38/39         0G    0.03682     0.0139    0.00309         22        640: 100% 4/4 [01:45<00:00, 26.32s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.91s/it]
                   all          8          8      0.985      0.996      0.995      0.725

      Epoch    GPU_mem   box_loss   obj_loss   cls_loss  Instances       Size
  0% 0/4 [00:00<?, ?it/s]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      39/39         0G    0.04925    0.01303   0.005979         33        640:  25% 1/4 [00:26<01:19, 26.63s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      39/39         0G    0.04677     0.0143   0.005792         31        640:  50% 2/4 [00:53<00:53, 26.86s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      39/39         0G    0.04606    0.01506   0.004959         41        640:  75% 3/4 [01:20<00:26, 26.88s/it]/content/yolov5/train.py:414: FutureWarning: `torch.cuda.amp.autocast(args...)` is deprecated. Please use `torch.amp.autocast('cuda', args...)` instead.
  with torch.cuda.amp.autocast(amp):
      39/39         0G    0.04353    0.01463   0.004131         34        640: 100% 4/4 [01:48<00:00, 27.00s/it]
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:02<00:00,  2.91s/it]
                   all          8          8      0.983      0.991      0.995      0.749

40 epochs completed in 1.279 hours.
Optimizer stripped from runs/train/treino_40_epocas/weights/last.pt, 14.4MB
Optimizer stripped from runs/train/treino_40_epocas/weights/best.pt, 14.4MB

Validating runs/train/treino_40_epocas/weights/best.pt...
Fusing layers... 
Model summary: 157 layers, 7015519 parameters, 0 gradients, 15.8 GFLOPs
                 Class     Images  Instances          P          R      mAP50   mAP50-95: 100% 1/1 [00:03<00:00,  3.97s/it]
                   all          8          8      0.976      0.983      0.995      0.791
             bicicleta          8          4          1      0.966      0.995      0.908
                 carro          8          4      0.952          1      0.995      0.673
Results saved to runs/train/treino_40_epocas
✅ Treinamento finalizado: 18:06:25

📊 Análise dos Resultados - 40 Épocas¶

In [12]:
# Visualizar gráfico de resultados do treino (40 épocas)
print("📈 Gráfico de métricas de treinamento (40 épocas):")
display(Image(filename='/content/yolov5/runs/train/treino_40_epocas/results.png'))
📈 Gráfico de métricas de treinamento (40 épocas):
No description has been provided for this image
In [13]:
# Visualizar exemplos de predições no conjunto de validação
print("🔍 Exemplos de predições no conjunto de validação (40 épocas):")
display(Image(filename='/content/yolov5/runs/train/treino_40_epocas/val_batch0_pred.jpg'))
🔍 Exemplos de predições no conjunto de validação (40 épocas):
No description has been provided for this image
In [14]:
# Visualizar matriz de confusão
print("📊 Matriz de Confusão (40 épocas):")
display(Image(filename='/content/yolov5/runs/train/treino_40_epocas/confusion_matrix.png'))
📊 Matriz de Confusão (40 épocas):
No description has been provided for this image

📊 6. COMPARAÇÃO ENTRE 15 vs 40 ÉPOCAS¶

Vamos analisar comparativamente os resultados dos dois treinamentos.

In [33]:
# Comparação visual lado a lado
from IPython.display import Image, display
import matplotlib.pyplot as plt
from PIL import Image as PILImage
import numpy as np

print("🔄 Comparação Visual dos Gráficos de Resultados:\n")

# Carregar as imagens
img1 = PILImage.open('/content/yolov5/runs/train/treino_15_epocas/results.png')
img2 = PILImage.open('/content/yolov5/runs/train/treino_40_epocas/results.png')

# Criar figura com 2 subplots lado a lado
fig, axes = plt.subplots(1, 2, figsize=(20, 8))

# Mostrar imagens
axes[0].imshow(img1)
axes[0].set_title('15 Épocas', fontsize=16, fontweight='bold')
axes[0].axis('off')

axes[1].imshow(img2)
axes[1].set_title('40 Épocas', fontsize=16, fontweight='bold')
axes[1].axis('off')

plt.tight_layout()
plt.show()
🔄 Comparação Visual dos Gráficos de Resultados:

No description has been provided for this image

📊 COMPARAÇÃO AUTOMÁTICA ENTRE TREINAMENTOS¶

Este código lê automaticamente os resultados reais dos treinamentos e cria tabelas e análises comparativas.

In [34]:
import pandas as pd
import os
import re
from datetime import datetime

def extrair_metricas_completas(caminho_treino):
    """
    Extrai métricas completas do arquivo results.csv gerado pelo YOLOv5

    Args:
        caminho_treino: Caminho para a pasta do treinamento (ex: 'runs/train/treino_15_epocas')

    Returns:
        dict com as métricas da última época
    """
    results_csv = f'{caminho_treino}/results.csv'

    if not os.path.exists(results_csv):
        print(f"❌ Arquivo não encontrado: {results_csv}")
        return None

    try:
        # Ler CSV
        df = pd.read_csv(results_csv)

        # Limpar nomes das colunas (remover espaços)
        df.columns = df.columns.str.strip()

        # Pegar última linha (última época)
        ultima_epoca = df.iloc[-1]

        # Extrair métricas
        metricas = {
            'epoca': int(ultima_epoca['epoch']) + 1,  # +1 porque começa do 0
            'box_loss': float(ultima_epoca['train/box_loss']),
            'obj_loss': float(ultima_epoca['train/obj_loss']),
            'cls_loss': float(ultima_epoca['train/cls_loss']),
            'precision': float(ultima_epoca['metrics/precision']),
            'recall': float(ultima_epoca['metrics/recall']),
            'mAP50': float(ultima_epoca['metrics/mAP_0.5']),
            'mAP50_95': float(ultima_epoca['metrics/mAP_0.5:0.95']),
            'val_box_loss': float(ultima_epoca['val/box_loss']),
            'val_obj_loss': float(ultima_epoca['val/obj_loss']),
            'val_cls_loss': float(ultima_epoca['val/cls_loss'])
        }

        return metricas

    except Exception as e:
        print(f"❌ Erro ao processar {results_csv}: {e}")
        return None


# Listar treinamentos disponíveis
train_dir = '/content/yolov5/runs/train'

if os.path.exists(train_dir):
    treinamentos = [d for d in os.listdir(train_dir)
                   if os.path.isdir(os.path.join(train_dir, d))]

    print("📂 Treinamentos encontrados:")
    for t in treinamentos:
        print(f"   - {t}")
else:
    print("❌ Pasta de treinamentos não encontrada!")
    treinamentos = []


# Definir quais treinamentos comparar
# Aqui a gente pode incluir os treinamentos disponíveis para comparação
treinos_para_comparar = ['treino_15_epocas', 'treino_40_epocas']

print("\n🔍 Extraindo métricas dos treinamentos...\n")

resultados = {}

for treino in treinos_para_comparar:
    caminho = f'/content/yolov5/runs/train/{treino}'

    if os.path.exists(caminho):
        print(f"📊 Processando: {treino}")
        metricas = extrair_metricas_completas(caminho)

        if metricas:
            resultados[treino] = metricas
            print(f"   ✅ {metricas['epoca']} épocas completadas")
            print(f"   📈 mAP@0.5: {metricas['mAP50']:.4f}")
            print(f"   📈 mAP@0.5:0.95: {metricas['mAP50_95']:.4f}\n")
        else:
            print(f"   ❌ Falha ao extrair métricas\n")
    else:
        print(f"❌ Pasta não encontrada: {treino}\n")

# Criar DataFrame comparativo
if len(resultados) >= 2:
    print("=" * 80)
    print("📊 TABELA COMPARATIVA AUTOMÁTICA")
    print("=" * 80 + "\n")

    # Preparar dados para o DataFrame
    dados_comparacao = {
        'Métrica': [],
        treinos_para_comparar[0]: [],
        treinos_para_comparar[1]: [],
        'Diferença': [],
        'Variação %': []
    }

    # Lista de métricas a comparar
    metricas_para_mostrar = [
        ('mAP50', 'mAP@0.5 (Geral)', 'melhora'),
        ('mAP50_95', 'mAP@0.5:0.95 (Geral)', 'melhora'),
        ('precision', 'Precision (Geral)', 'melhora'),
        ('recall', 'Recall (Geral)', 'melhora'),
        ('box_loss', 'Box Loss (Train)', 'reduz'),
        ('obj_loss', 'Object Loss (Train)', 'reduz'),
        ('cls_loss', 'Class Loss (Train)', 'reduz'),
        ('val_box_loss', 'Box Loss (Val)', 'reduz'),
        ('val_obj_loss', 'Object Loss (Val)', 'reduz'),
        ('val_cls_loss', 'Class Loss (Val)', 'reduz')
    ]

    treino1_nome = treinos_para_comparar[0]
    treino2_nome = treinos_para_comparar[1]
    treino1 = resultados[treino1_nome]
    treino2 = resultados[treino2_nome]

    for metrica_key, metrica_nome, tipo in metricas_para_mostrar:
        valor1 = treino1[metrica_key]
        valor2 = treino2[metrica_key]
        diferenca = valor2 - valor1

        # Calcular variação percentual
        if valor1 != 0:
            variacao_pct = (diferenca / abs(valor1)) * 100
        else:
            variacao_pct = 0

        # Determinar símbolo
        if tipo == 'melhora':
            simbolo = '↑' if diferenca > 0 else '↓'
            cor_emoji = '🟢' if diferenca > 0 else '🔴'
        else:  # tipo == 'reduz'
            simbolo = '↓' if diferenca < 0 else '↑'
            cor_emoji = '🟢' if diferenca < 0 else '🔴'

        dados_comparacao['Métrica'].append(metrica_nome)
        dados_comparacao[treino1_nome].append(f"{valor1:.4f}")
        dados_comparacao[treino2_nome].append(f"{valor2:.4f}")
        dados_comparacao['Diferença'].append(f"{simbolo} {abs(diferenca):.4f}")
        dados_comparacao['Variação %'].append(f"{cor_emoji} {variacao_pct:+.2f}%")

    # Adicionar informação de épocas e tempo
    dados_comparacao['Métrica'].append('─' * 30)
    dados_comparacao[treino1_nome].append('─' * 10)
    dados_comparacao[treino2_nome].append('─' * 10)
    dados_comparacao['Diferença'].append('─' * 10)
    dados_comparacao['Variação %'].append('─' * 10)

    dados_comparacao['Métrica'].append('Épocas Treinadas')
    dados_comparacao[treino1_nome].append(f"{treino1['epoca']}")
    dados_comparacao[treino2_nome].append(f"{treino2['epoca']}")
    dados_comparacao['Diferença'].append(f"+{treino2['epoca'] - treino1['epoca']}")
    dados_comparacao['Variação %'].append(f"{((treino2['epoca'] / treino1['epoca']) - 1) * 100:+.1f}%")

    # Criar DataFrame
    df_comparacao = pd.DataFrame(dados_comparacao)

    # Exibir tabela
    print(df_comparacao.to_string(index=False))
    print("\n" + "=" * 80)

else:
    print("⚠️  Não há treinamentos suficientes para comparar")
📂 Treinamentos encontrados:
   - treino_15_epocas
   - treino_40_epocas

🔍 Extraindo métricas dos treinamentos...

📊 Processando: treino_15_epocas
   ✅ 15 épocas completadas
   📈 mAP@0.5: 0.9200
   📈 mAP@0.5:0.95: 0.5759

📊 Processando: treino_40_epocas
   ✅ 40 épocas completadas
   📈 mAP@0.5: 0.9950
   📈 mAP@0.5:0.95: 0.7493

================================================================================
📊 TABELA COMPARATIVA AUTOMÁTICA
================================================================================

                       Métrica treino_15_epocas treino_40_epocas  Diferença Variação %
               mAP@0.5 (Geral)           0.9200           0.9950   ↑ 0.0750   🟢 +8.15%
          mAP@0.5:0.95 (Geral)           0.5759           0.7493   ↑ 0.1735  🟢 +30.12%
             Precision (Geral)           0.8804           0.9830   ↑ 0.1025  🟢 +11.65%
                Recall (Geral)           0.8750           0.9908   ↑ 0.1158  🟢 +13.23%
              Box Loss (Train)           0.0603           0.0435   ↓ 0.0168  🟢 -27.86%
           Object Loss (Train)           0.0231           0.0146   ↓ 0.0085  🟢 -36.74%
            Class Loss (Train)           0.0134           0.0041   ↓ 0.0092  🟢 -69.12%
                Box Loss (Val)           0.0294           0.0184   ↓ 0.0110  🟢 -37.46%
             Object Loss (Val)           0.0166           0.0074   ↓ 0.0092  🟢 -55.57%
              Class Loss (Val)           0.0055           0.0011   ↓ 0.0044  🟢 -80.21%
──────────────────────────────       ──────────       ────────── ────────── ──────────
              Épocas Treinadas               15               40        +25    +166.7%

================================================================================
In [35]:
# Análise visual com gráfico de barras
if len(resultados) >= 2:
    import matplotlib.pyplot as plt
    import numpy as np

    print("\n📊 VISUALIZAÇÃO COMPARATIVA\n")

    # Métricas principais para visualizar
    metricas_viz = ['mAP50', 'mAP50_95', 'precision', 'recall']
    nomes_viz = ['mAP@0.5', 'mAP@0.5:0.95', 'Precision', 'Recall']

    treino1 = resultados[treinos_para_comparar[0]]
    treino2 = resultados[treinos_para_comparar[1]]

    # Extrair valores
    valores_treino1 = [treino1[m] for m in metricas_viz]
    valores_treino2 = [treino2[m] for m in metricas_viz]

    # Configurar gráfico
    x = np.arange(len(nomes_viz))
    width = 0.35

    fig, ax = plt.subplots(figsize=(12, 6))

    bars1 = ax.bar(x - width/2, valores_treino1, width,
                   label=f'{treinos_para_comparar[0]} ({treino1["epoca"]} épocas)',
                   color='#3498db', alpha=0.8)
    bars2 = ax.bar(x + width/2, valores_treino2, width,
                   label=f'{treinos_para_comparar[1]} ({treino2["epoca"]} épocas)',
                   color='#2ecc71', alpha=0.8)

    # Adicionar valores nas barras
    for bars in [bars1, bars2]:
        for bar in bars:
            height = bar.get_height()
            ax.text(bar.get_x() + bar.get_width()/2., height,
                   f'{height:.3f}',
                   ha='center', va='bottom', fontsize=10, fontweight='bold')

    # Configurações do gráfico
    ax.set_xlabel('Métricas', fontsize=12, fontweight='bold')
    ax.set_ylabel('Valores', fontsize=12, fontweight='bold')
    ax.set_title('Comparação de Métricas entre Treinamentos',
                fontsize=14, fontweight='bold', pad=20)
    ax.set_xticks(x)
    ax.set_xticklabels(nomes_viz)
    ax.legend(fontsize=11)
    ax.grid(axis='y', alpha=0.3, linestyle='--')
    ax.set_ylim([0, 1.1])

    plt.tight_layout()
    plt.show()
📊 VISUALIZAÇÃO COMPARATIVA

No description has been provided for this image
In [36]:
# Resumo executivo
if len(resultados) >= 2:
    print("\n" + "=" * 80)
    print("📝 RESUMO EXECUTIVO DA COMPARAÇÃO")
    print("=" * 80 + "\n")

    treino1 = resultados[treinos_para_comparar[0]]
    treino2 = resultados[treinos_para_comparar[1]]

    # Calcular melhorias
    melhoria_mAP50 = ((treino2['mAP50'] - treino1['mAP50']) / treino1['mAP50']) * 100
    melhoria_mAP50_95 = ((treino2['mAP50_95'] - treino1['mAP50_95']) / treino1['mAP50_95']) * 100
    melhoria_precision = ((treino2['precision'] - treino1['precision']) / treino1['precision']) * 100
    melhoria_recall = ((treino2['recall'] - treino1['recall']) / treino1['recall']) * 100

    reducao_loss = ((treino1['val_box_loss'] - treino2['val_box_loss']) / treino1['val_box_loss']) * 100

    print(f"🎯 **Configurações:**")
    print(f"   • Treino 1: {treino1['epoca']} épocas")
    print(f"   • Treino 2: {treino2['epoca']} épocas")
    print(f"   • Diferença: +{treino2['epoca'] - treino1['epoca']} épocas ({((treino2['epoca'] / treino1['epoca']) - 1) * 100:.1f}% mais treinamento)\n")

    print(f"📈 **Melhorias em Performance:**")
    print(f"   • mAP@0.5: {treino1['mAP50']:.4f} → {treino2['mAP50']:.4f} ({melhoria_mAP50:+.2f}%)")
    print(f"   • mAP@0.5:0.95: {treino1['mAP50_95']:.4f} → {treino2['mAP50_95']:.4f} ({melhoria_mAP50_95:+.2f}%)")
    print(f"   • Precision: {treino1['precision']:.4f} → {treino2['precision']:.4f} ({melhoria_precision:+.2f}%)")
    print(f"   • Recall: {treino1['recall']:.4f} → {treino2['recall']:.4f} ({melhoria_recall:+.2f}%)\n")

    print(f"📉 **Redução de Loss (Erro):**")
    print(f"   • Validation Box Loss: {treino1['val_box_loss']:.4f} → {treino2['val_box_loss']:.4f} (-{reducao_loss:.2f}%)\n")

    print(f"🏆 **Conclusão:**")

    if melhoria_mAP50 > 5:
        print(f"   ✅ Melhoria SIGNIFICATIVA no mAP@0.5 (+{melhoria_mAP50:.1f}%)")
        print(f"   ✅ O aumento de épocas trouxe ganhos expressivos de performance")
    elif melhoria_mAP50 > 0:
        print(f"   ✅ Melhoria MODERADA no mAP@0.5 (+{melhoria_mAP50:.1f}%)")
        print(f"   ⚠️  Ganhos incrementais - avaliar custo-benefício do tempo extra")
    else:
        print(f"   ⚠️  Sem melhoria significativa no mAP@0.5")
        print(f"   💡 Possível saturação do modelo - considere outras otimizações")

    if melhoria_mAP50_95 > 10:
        print(f"   ✅ Melhoria EXPRESSIVA no mAP@0.5:0.95 (+{melhoria_mAP50_95:.1f}%)")
        print(f"   ✅ Modelo ficou mais robusto em diferentes thresholds de IoU")

    print("\n" + "=" * 80)
================================================================================
📝 RESUMO EXECUTIVO DA COMPARAÇÃO
================================================================================

🎯 **Configurações:**
   • Treino 1: 15 épocas
   • Treino 2: 40 épocas
   • Diferença: +25 épocas (166.7% mais treinamento)

📈 **Melhorias em Performance:**
   • mAP@0.5: 0.9200 → 0.9950 (+8.15%)
   • mAP@0.5:0.95: 0.5759 → 0.7493 (+30.12%)
   • Precision: 0.8804 → 0.9830 (+11.65%)
   • Recall: 0.8750 → 0.9908 (+13.23%)

📉 **Redução de Loss (Erro):**
   • Validation Box Loss: 0.0294 → 0.0184 (-37.46%)

🏆 **Conclusão:**
   ✅ Melhoria SIGNIFICATIVA no mAP@0.5 (+8.2%)
   ✅ O aumento de épocas trouxe ganhos expressivos de performance
   ✅ Melhoria EXPRESSIVA no mAP@0.5:0.95 (+30.1%)
   ✅ Modelo ficou mais robusto em diferentes thresholds de IoU

================================================================================

🎯 Análise Crítica: 15 vs 40 Épocas¶

1. Evolução Geral do Modelo¶

Com o aumento de 15 para 40 épocas, observamos melhorias significativas:

  • mAP@0.5: Aumentou de 92% para 99.5% (+7.5 pontos percentuais)
  • mAP@0.5:0.95: Salto expressivo de 57.6% para 79.1% (+21.5 pontos)

Isso indica que o modelo não apenas melhorou na detecção básica, mas também ficou mais preciso em diferentes thresholds de IoU (Intersection over Union).

2. Performance por Classe¶

Bicicletas (maior ganho):

  • Precision: 83.3% → 100% (+16.7%)
  • Recall: 75% → 96.6% (+21.6%)
  • O modelo inicialmente tinha dificuldade com bicicletas devido à estrutura mais complexa (rodas vazadas, diferentes ângulos). Com mais épocas, aprendeu melhor as características distintivas.

Carros (já excelente):

  • Manteve Recall perfeito (100%)
  • Precision leve queda: 92.2% → 95.2%
  • Carros são mais fáceis de detectar: formas sólidas e padronizadas

3. Convergência do Modelo¶

Analisando os gráficos de loss:

  • Box Loss: Redução consistente (melhor localização das bounding boxes)
  • Obj Loss: Diminuição contínua (melhor detecção de objetos)
  • Cls Loss: Próximo de zero (excelente classificação entre as 2 classes)

Não há sinais evidentes de overfitting, pois as curvas de validação acompanham as de treinamento sem divergência.

4. Trade-off: Tempo vs Performance¶

  • Tempo: 40 épocas levaram 2.7x mais tempo que 15 épocas
  • Ganho: +7.5% em mAP@0.5, +21.5% em mAP@0.5:0.95
  • Conclusão: O trade-off é favorável para aplicações que necessitam alta precisão. Para aplicações em tempo real com recursos limitados, 15 épocas já oferece performance aceitável (92% mAP@0.5).

5. Pontos Fortes do Sistema¶

✅ Dataset bem balanceado (4 imagens de cada classe no validation) ✅ Rotulação precisa (corrigida após identificação do erro inicial) ✅ Convergência saudável sem overfitting ✅ Performance final excelente (99.5% mAP@0.5) ✅ Generalizável para cenários similares

6. Limitações Identificadas¶

⚠️ Dataset pequeno: 64 imagens de treino é limitado ⚠️ Diversidade: Imagens parecem ter contextos similares (urbano) ⚠️ Oclusão: Não testado com objetos parcialmente escondidos ⚠️ Condições: Falta variedade de iluminação, clima, ângulos extremos

7. Melhorias Futuras¶

  1. Data Augmentation: Rotação, flip, mudança de brilho/contraste
  2. Mais dados: Expandir para 200+ imagens por classe
  3. Cenários diversos: Noite, chuva, oclusão parcial
  4. Teste em vídeo: Avaliar performance em tempo real
  5. Outras classes: Adicionar motos, caminhões, pedestres

🏆 Conclusão Final:

O modelo YOLOv5 customizado demonstrou excelente capacidade de aprendizado, evoluindo de 92% para 99.5% de mAP@0.5 com o aumento de épocas. A arquitetura se mostrou adequada para o problema de detecção de bicicletas vs carros, com resultados que validam sua aplicabilidade em cenários reais de monitoramento e segurança patrimonial conforme proposto pela FarmTech Solutions.

🧪 7. TESTE COM IMAGENS DO CONJUNTO DE TESTE¶

Agora vamos testar o modelo treinado (40 épocas) com as imagens do conjunto de teste.

In [26]:
# Realizar detecção nas imagens de teste usando o modelo de 60 épocas
print("🔍 Executando detecções nas imagens de teste...")

# Verificar modelo
%cd /content/yolov5

!python detect.py \
  --weights runs/train/treino_40_epocas/weights/best.pt \
  --img 640 \
  --conf 0.25 \
  --source /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images \
  --name teste_final \
  --save-txt \
  --save-conf

print("✅ Detecções concluídas!")
🔍 Executando detecções nas imagens de teste...
/content/yolov5
detect: weights=['runs/train/treino_40_epocas/weights/best.pt'], source=/content/drive/MyDrive/FIAP/FASE_6/dataset/test/images, data=data/coco128.yaml, imgsz=[640, 640], conf_thres=0.25, iou_thres=0.45, max_det=1000, device=, view_img=False, save_txt=True, save_format=0, save_csv=False, save_conf=True, save_crop=False, nosave=False, classes=None, agnostic_nms=False, augment=False, visualize=False, update=False, project=runs/detect, name=teste_final, exist_ok=False, line_thickness=3, hide_labels=False, hide_conf=False, half=False, dnn=False, vid_stride=1
YOLOv5 🚀 v7.0-441-g15c0127a Python-3.12.12 torch-2.8.0+cu126 CPU

Fusing layers... 
Model summary: 157 layers, 7015519 parameters, 0 gradients, 15.8 GFLOPs
image 1/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/bike_037.bmp: 480x640 1 bicicleta, 365.4ms
image 2/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/bike_038.bmp: 480x640 1 bicicleta, 357.3ms
image 3/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/bike_039.bmp: 480x640 1 bicicleta, 323.6ms
image 4/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/bike_040.bmp: 480x640 1 bicicleta, 490.8ms
image 5/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/carsgraz_037.bmp: 480x640 1 carro, 481.7ms
image 6/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/carsgraz_038.bmp: 480x640 1 carro, 326.5ms
image 7/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/carsgraz_039.bmp: 480x640 (no detections), 319.8ms
image 8/8 /content/drive/MyDrive/FIAP/FASE_6/dataset/test/images/carsgraz_040.bmp: 480x640 1 carro, 313.6ms
Speed: 1.7ms pre-process, 372.3ms inference, 1.2ms NMS per image at shape (1, 3, 640, 640)
Results saved to runs/detect/teste_final6
7 labels saved to runs/detect/teste_final6/labels
✅ Detecções concluídas!

Visualizar resultados das detecções¶

In [32]:
import glob
from PIL import Image
import matplotlib.pyplot as plt

test_results_path = 'teste_final6' # aqui tem que ser trocado pelo diretório correto, a depender das tentativas de executação do teste anterior.

imgs = glob.glob(f'runs/detect/${test_results_path}/*.bmp')

for img_path in imgs:
    img = Image.open(img_path)
    plt.figure(figsize=(10, 6))
    plt.imshow(img)
    plt.axis('off')
    plt.title(img_path.split('/')[-1])
    plt.show()
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image
No description has been provided for this image

📊 Análise dos Resultados de Teste¶

Performance no conjunto de teste (8 imagens):

Taxa de Detecção Geral: 7/8 objetos detectados (87.5%)

Por Classe:

  • Bicicletas: 4/4 detectadas (100%) ✅

    • Todas as bicicletas foram corretamente identificadas
    • Confiança média alta (~0.7-0.8)
  • Carros: 3/4 detectados (75%) ⚠️

    • 1 falha: carsgraz_039.bmp não foi detectado
    • Possível causa: ângulo, oclusão ou baixo contraste

Observações:

  1. O modelo teve excelente performance em bicicletas (100%)
  2. Carros tiveram 1 falso negativo (25% erro)
  3. Não houve falsos positivos
  4. Confiança das detecções: alta (>0.6)

Casos de Sucesso:

  • Bicicletas detectadas corretamente mesmo com diferentes ângulos
  • Carros identificados em cenários urbanos

Limitações Identificadas:

  • 1 carro não detectado (investigar características da imagem)
  • Dataset de teste pequeno (apenas 8 imagens)

Conclusão: O modelo demonstrou boa generalização com 87.5% de acerto no teste, validando os resultados de treinamento (mAP@0.5 de 99.5%).